package com.jprocms.module.cms.controller.admin.task.vo;

import com.jpro.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static com.jpro.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 任务分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class TaskPageReqVO extends PageParam {

    @Schema(description = "站点ID", example = "2168")
    private Long siteId;

    @Schema(description = "用户ID", example = "8147")
    private Long userId;

    @Schema(description = "任务类型", example = "1")
    private Short taskType;


    @Schema(description = "名称", example = "张三")
    private String name;

    @Schema(description = "开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] beginTime;

    @Schema(description = "结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] endTime;

    @Schema(description = "已完成数量")
    private Integer currentNum;

    @Schema(description = "总数量")
    private Integer totalNum;

    @Schema(description = "状态(0:等待,1:运行中,2:出错,3:停止,4:完成)", example = "2")
    private Short status;

    @Schema(description = "错误信息")
    private String errorMsg;

}
